package com.team11.server.controller.teacher;

import com.team11.server.pojo.dto.RespPageBean;
import com.team11.server.pojo.dto.SKStudentRecord;
import com.team11.server.pojo.dto.vo.SkStudentRecordVo;
import com.team11.server.service.ISInformationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;


/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author pjc
 * @since 2021-06-15
 */
@CrossOrigin
@RestController
@RequestMapping("/teacher")
@Api(tags = "教师接口")
public class TeacherSInformationController {

    @Resource
    private ISInformationService isInformationService;

    @ApiOperation(value = "项目课程表：教师查看实训项目课程的学生列表（分页）---")
    @PostMapping("/getStudentByKcSID")
    public RespPageBean getStudentByKcSID(@RequestParam(defaultValue = "1") Integer currentPage,
                                          @RequestParam(defaultValue = "10") Integer size,
                                          @RequestParam("kc_s_id") Integer kc_s_id,
                                          SkStudentRecordVo skStudentRecordVo) {
        return isInformationService.getStudentByKcSID(currentPage, size, kc_s_id, skStudentRecordVo);
    }

    @ApiOperation(value = "下发作业-->下拉框：根据小组id获取学生及其id")
    @GetMapping("/getStudentByPId")
    public List getStudentByPId(@RequestParam("PId") List<Integer> pId) {
        List list = isInformationService.getStudentByPId(pId);
        return list;
    }

}
